// @ts-ignore
/* eslint-disable */
import { request } from 'umi';

/** 解决农药到期 POST /warning/addPesticideUsageRecord */
export async function addPesticideUsageRecordUsingPOST1(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.addPesticideUsageRecordUsingPOST1Params,
  body: API.PesticideUsageRecord,
  options?: { [key: string]: any },
) {
  return request<API.BaseResult>('/warning/addPesticideUsageRecord', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    params: {
      ...params,
    },
    data: body,
    ...(options || {}),
  });
}

/** 解决肥效期到期 POST /warning/insertFertilizerUsageRecord */
export async function insertFertilizerUsageRecordUsingPOST1(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.insertFertilizerUsageRecordUsingPOST1Params,
  body: API.FertilizerUsageRecords,
  options?: { [key: string]: any },
) {
  return request<API.BaseResult>('/warning/insertFertilizerUsageRecord', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    params: {
      ...params,
    },
    data: body,
    ...(options || {}),
  });
}

/** 查询低于设置阈值天数的农药或者肥料使用记录的预警信息列表 GET /warning/queryDueListByName/${param0} */
export async function queryListOfDueByNameUsingGET(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.queryListOfDueByNameUsingGETParams,
  options?: { [key: string]: any },
) {
  const { name: param0, ...queryParams } = params;
  return request<API.BaseResult>(`/warning/queryDueListByName/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 查询农药或者肥料的库存预警列表 GET /warning/queryListOfWarningByName/${param0} */
export async function queryListOfWarningByNameUsingGET(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.queryListOfWarningByNameUsingGETParams,
  options?: { [key: string]: any },
) {
  const { name: param0, ...queryParams } = params;
  return request<API.BaseResult>(`/warning/queryListOfWarningByName/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 肥效期预警数据的种植地点果蔬信息 GET /warning/queryLocationByFertilizerUseId/${param0} */
export async function queryLocationByFertilizerUseIdUsingGET(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.queryLocationByFertilizerUseIdUsingGETParams,
  options?: { [key: string]: any },
) {
  const { id: param0, ...queryParams } = params;
  return request<API.BaseResultPlantAndVegTableInfo_>(
    `/warning/queryLocationByFertilizerUseId/${param0}`,
    {
      method: 'GET',
      params: { ...queryParams },
      ...(options || {}),
    },
  );
}

/** 农药期预警数据的种植地点果蔬信息 GET /warning/queryLocationByPesticideUseId/${param0} */
export async function queryLocationByPesticideUseIdUsingGET(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.queryLocationByPesticideUseIdUsingGETParams,
  options?: { [key: string]: any },
) {
  const { id: param0, ...queryParams } = params;
  return request<API.BaseResultPlantAndVegTableInfo_>(
    `/warning/queryLocationByPesticideUseId/${param0}`,
    {
      method: 'GET',
      params: { ...queryParams },
      ...(options || {}),
    },
  );
}

/** 查询预警信息数量 GET /warning/queryNumOfWarning */
export async function queryNumOfWarningUsingGET(options?: { [key: string]: any }) {
  return request<API.BaseResultMapStringInt_>('/warning/queryNumOfWarning', {
    method: 'GET',
    ...(options || {}),
  });
}

/** 更新肥料库存不足 POST /warning/updateInsufficientStock/fertilizer */
export async function updateInsufficientStockOfFertilizerUsingPOST(
  body: API.Fertilizer,
  options?: { [key: string]: any },
) {
  return request<API.BaseResult>('/warning/updateInsufficientStock/fertilizer', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 更新农药库存不足 POST /warning/updateInsufficientStock/pesticide */
export async function updateInsufficientStockOfPesticideTypeUsingPOST(
  body: API.PesticideType,
  options?: { [key: string]: any },
) {
  return request<API.BaseResult>('/warning/updateInsufficientStock/pesticide', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
